package api

import (
	"fmt"

	"github.com/gin-gonic/gin"
	"kurbrick.com/test-web-server/model"
	"kurbrick.com/test-web-server/utils"
	"kurbrick.com/test-web-server/vo"
)

// AccountById 根据id查询数据
func AccountById(c *gin.Context) {
	// 获取参数
	id := c.Param("id")
	fmt.Println("id" + id)
	// 根据id查询数据
	account := &model.AccountEntity{
		UserName: "kubrick",
		BaseEntity: model.BaseEntity{
			ID: 30,
		},
	}
	// 成功返回
	utils.Success(c, vo.ToAccountModelToRes(*account))
}
